using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
class MyForm:Form
{
	private System.Windows.Forms.DataGrid dataGrid1;

	private void InitializeComponent()
	{
		this.dataGrid1 = new System.Windows.Forms.DataGrid();
		((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
		this.SuspendLayout();
		// 
		// dataGrid1
		// 
		this.dataGrid1.DataMember = "";
		this.dataGrid1.FlatMode = true;
		this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
		this.dataGrid1.Location = new System.Drawing.Point(0, 56);
		this.dataGrid1.Name = "dataGrid1";
		this.dataGrid1.Size = new System.Drawing.Size(296, 128);
		this.dataGrid1.TabIndex = 0;
		// 
		// MyForm
		// 
		this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
		this.ClientSize = new System.Drawing.Size(292, 273);
		this.Controls.Add(this.dataGrid1);
		this.Name = "MyForm";
		((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
		this.ResumeLayout(false);

	}

	public MyForm()
	{
		InitializeComponent();

		string strConn = "Data Source=ZHUBICEN; Initial Catalog=Student; User ID=sa; Password=123456;";
		SqlConnection conn = new SqlConnection(strConn);
		SqlCommand cmd = new SqlCommand("SELECT * FROM Student",conn);
		SqlDataAdapter adapter = new SqlDataAdapter();
		adapter.SelectCommand = cmd;
		DataSet ds = new DataSet();
		adapter.Fill(ds);
		this.dataGrid1.DataSource = ds;
    
	}

}
class APP
{
	static void Main()
	{
		Application.Run(new MyForm());
	}
}
